//
//  GlobalMethods.m
//  Sotao
//
//  Created by hk on 14-9-18.
//  Copyright (c) 2014年 搜淘APP. All rights reserved.
//

#import "GlobalMethods.h"

@implementation GlobalMethods
+(NSString *)changgeStr:(NSString *)str
{
    if ([str isKindOfClass:[NSNull class]] || str == nil ||[str isEqualToString:@"null"]) {
        return @"";
    }else{
        return [NSString stringWithFormat:@"%@",str];
    }
}


+(NSURL *)imageUrlString:(NSString *)urlString
{
    NSString *string = CSTR(urlString);
    if (![urlString hasPrefix:@"/"]) {
        string = [NSString stringWithFormat:@"http://api.mobile.sotao.com/%@",string];
    }else
    {
        string = [NSString stringWithFormat:@"http://api.mobile.sotao.com%@",string];
    }
    NSURL *url = [NSURL URLWithString:string];
    return url;
}
@end
